<template>
  <view class="index">
    <Info :info="info" :id="userId" />
    <List :circles="circles" />
  </view>
</template>

<script>
import Info from '@components/circle/person/info'
import List from '@components/circle/person/List'
import { getParam } from '@utils/index'
import { getPersonInfo, getPersonCircles } from '@requests/circle'

export default {
  name: 'FindCars',
  data() {
    return {
      userId: 0,
      info: {},
      circles: []
    }
  },
  components: { Info, List },
  computed: {},
  created() {
    this.userId = +getParam('id')
    this.getPersonInfo()
    this.getCircles(0)
  },
  methods: {
    getPersonInfo() {
      getPersonInfo(this.userId).then(res => {
        this.info = res.result
      })
    },
    getCircles(last_id) {
      getPersonCircles(this.userId, last_id).then(res => {
        this.circles = res.result.list
      })
    }
  }
}
</script>

<style>
.index {
  background: #f9f9f9;
}
</style>
